package com.melon.basic.internet.socket;

import java.io.DataOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

/**
 * Created with IntelliJ IDEA.
 * Author: xjt2016
 * Date: 2016/8/25
 * Time: 19:51
 */
public class DemoClient {
    public static void main(String[] args) throws IOException {
        Socket client = new Socket("127.0.0.1", 6066);
        OutputStream outToServer = client.getOutputStream();
        DataOutputStream out = new DataOutputStream(outToServer);
        out.writeUTF("Hello from " + client.getLocalSocketAddress());

        client.close();
    }
}
